[Internal] Use resolved host type from host metadata in getHostType()#749
Draft
[Internal] Use resolved host type from host metadata in getHostType()#749
Conversation
Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
This was referenced Mar 30, 2026
Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
de63be7 to
ae9813b
Compare
Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
ae9813b to
6b1ed72
Compare
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🥞 Stacked PR
Use this link to review incremental changes.
Summary
getHostType()now returns the host type resolved from host metadata when available, fallingback to URL pattern matching only when metadata has not been resolved.
Why
PRs #747 and #748 added
host_typeparsing toHostMetadataand store it inDatabricksConfig.resolvedHostType. However,getHostType()still relied solely on URLpattern matching. This meant the authoritative signal from the server was ignored.
URL pattern matching is fragile — it can't distinguish unified hosts, and custom or
non-standard URLs may not follow expected patterns. The metadata endpoint is the authoritative
source, so
getHostType()should prefer it.What changed
Interface changes
None.
getHostType()still returnsHostTypewith the same possible values.Behavioral changes
getHostType()now returnsresolvedHostTypewhen it is notnull, taking priorityover all existing fallback logic (including the experimental unified host flag and URL pattern
matching).
resolvedHostType == null), behavior is identical to before.Internal changes
resolvedHostTypecheck at top ofgetHostType()inDatabricksConfig.java.How is this tested?
6 new tests in
UnifiedHostTest:NO_CHANGELOG=true